ARCH:=arm-linux-
ARCH:=
CC:=$(ARCH)g++
OBJ:=$(patsubst %.cpp, %.o, $(shell ls *.cpp))
CFLAGS:= -I.
TARGET:= udpclient.exe udpserver.exe tcpclient.exe tcpserver.exe tcpepoll.exe udpepoll.exe

all:$(patsubst %, ztest/%, $(TARGET))
	@ls -1sh $+
ztest/udpclient.exe:$(OBJ) ztest/udpclient.cpp
	$(CC) $+ $(CFLAGS) -o $@
ztest/udpserver.exe:$(OBJ) ztest/udpserver.cpp
	$(CC) $+ $(CFLAGS) -o $@
ztest/tcpclient.exe:$(OBJ) ztest/tcpclient.cpp
	$(CC) $+ $(CFLAGS) -o $@
ztest/tcpserver.exe:$(OBJ) ztest/tcpserver.cpp
	$(CC) $+ $(CFLAGS) -o $@
ztest/tcpepoll.exe:$(OBJ) ztest/tcpepoll.cpp
	$(CC) $+ $(CFLAGS) -o $@
ztest/udpepoll.exe:$(OBJ) ztest/udpepoll.cpp
	$(CC) $+ $(CFLAGS) -o $@
.cpp.o:
	$(CC) $+ -c -o $@
clean:
	rm *.exe */*.exe *.o
